home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
gnuish
/
gmake371
/
readme.txt
< prev
next >
Wrap
Text File
|
1994-06-25
|
10KB
|
194 lines
Notes on the MS-DOS port of Gnu Make.
------------------------------------
This port of Gnu Make was done by Morten Welinder <terra@diku.dk>. Besides
the FSF sources, I have used some code from a previous port by Thorsten Ohl
<ohl@gnu.ai.mit.edu> who in turn used some public domain code written by
Michael Rendell <{uunet,utai}michael@garfield>. I have found some inspi-
ration and an occational piece of code in DJ Delorie's port of Gnu Make
version 3.69. Did I forget anyone?
The port is minimal in the sense that Gnu Make is still really a *nix
program. I have changed as little as possible in order to make the program
work reasonably. As an exception to this principle I have added a number
of typical MsDos extension to the list of suffixes in default.c, which see.
I have not tried (and I will not try) to target it to MsDos compilers.
To run this port of Gnu Make you'll need a 286 or better, some extended
memory, and MsDos version 3 or later. You'll also need a standalone
`echo' binary, or edit `job.c'
To re-compile the program you'll need Borland Turbo C (Borland C++ will
also do, I think; Microsoft C will probably need a little work) and Borland
Turbo Assembler (Microsoft's Macro Assembler will do after a little work).
You'll also need a good make program -- Borland's is broken and I don't
know about Microsoft's. Alternatively, you can build Gnu Make with Gnu CC
as port by DJ Delorie in his Djgpp package.
Before you recompile Gnu Make, you should configure the sources for the
compiler you want to use. You do this with the command "configure tc" or
"configure gcc". You need a stream editor (sed) for this to work.
The real mode version of Gnu Make will swap itself to Xms memory while it
executes another command. For this reason you will need approximately
150KB of Xms memory. If you haven't got that, you're out of luck, at least
for the time being. One day I might implement swapping to disk, but don't
count on it -- Xms is so much faster. Gnu Make takes up around 25K in
memory while it executes a child process.
When Gnu Make encounteres a command line of more than 127 characters (the
limit that Ms-Dos sets) it does not panic, but tries to use alternate
methods of command line passing:
1. If a variable ENVARGS is defined it should be a colon separated
list of command names including extension, but excluding path.
A value of "rm.exe:mv.exe:ls.exe" specifies that the three programs
can take arguments via the environment. This is done by defining
environment variables "_argc", "_argv0", ...
2. If a variable ATFILEARGS is defined it should be a colon separated
list of command names including extension, but excluding path.
A program in this list will receive "@tempfile" as command line
where tempfile is the name of a file (using `\', not '/') that
holds the real command line as one long string. Programs like
tasm.exe and tlink.exe are good candidates.
3. If the file is a wrapped executeable produced by djgpp, then
method 1 will be used.
4. If the first 31KB (don't ask) of the program file contains the
string "_argc" including a terminating 0, method 1 will be used
for the command. There is a small chance that this is incorrect
-- rewrite your makefile if that happens. (You would have to do
that anyway to get below 128 characters.)
If neither of these methods succeds, you're out of luck. You must rewrite
your makefile.
Gnu Make itself, of course, understands long arguments. It uses method 1.
If you wish to add this feature to one of your own programs, you can take
the function "getlongargs" in file "dosstuff.c" and call it as you see in
file "main.c". I hereby donate the function "getlongargs" to the public
domain. It is thus not covered by the GPL (see section 2 of the GPL) when
used this way.
Gnu Make knows about the internal commands and special chars of the shells
"command.com", "/bin/sh", "4dos.com", and "ndos.com". The latter two are
probably not up to date. If a special char is found on a command line (say
"|" for command.com), or if you use one of the internal commands (say "copy"
for command.com), a shell will be invoked to execute the command. The same
goes for batch files, i.e., command files whose names end in ".bat"
When a shell is invoked and it is "command.com" or "?dos.com" the command
the shell is to execute will be backslashed. This means that if the line
reads "c:/dos/mem <nul" and the shell is "command.com", Gnu Make will
execute "command.com /c c:\dos\mem <nul". If the slashes were not reversed
the shell would have complained.
Most makefiles contain "SHELL=/bin/sh". Unless you really have such a shell
you must edit the makefile. Inserting a "#" before "SHELL" will often do.
==============================================================================
Thirty Reasons Why You Should Say MSDOG and not MSDOS.
-- Also known as "MSDOG -- a study in autoincompatibility, inconsistence,
poor design, and general lack of thought."
Note: I have tried to be fair here by not mentioning design choices that
are simply different from what others have done. Therefore I don't have
an entry just for using "/" and not "-" as switch char. That is mostly a
matter of what you like.
1. The file system's limit of 8+3 stinks.
2. Redirection doesn't work with batch files.
3. The default shell (Command.Com) doesn't pass a child's return code
on to its caller. The internal commands don't return an error code.
4. Pipes, "foo|bar", are implemented by ">tempfile" and "<tempfile".
5. The execution time for a seek in a file is proportional to the offset
seeked to. Seeks in a directory are also proportional to the number
of files in the directory.
6. The default shell (Command.Com) disregards case of environment variables
while the rest of MSDOG doesn't. Also it doesn't allow setting of an
empty environment variable.
7. Command lines cannot be longer than 126 characters. This makes it more
fun to port utilities that execute other programs. As an example take
a look at Gnu Make.
8. Some file names like "huge.filename" are silently truncated to the
8+3 limit while others like "lots.of.dots" or ".emacs" simply are
illegal. (Actually, ".emacs" is only illegal in some version of MSDOG,
I believe.)
9. Executablility is based on file names, not on file attributes. Actually,
this is only really true for Command.Com because any file is executable
by MSDOG. It is, however, known to be rather unsafe just to execute an
arbitrary file as a series of machine instructions.
10. You can only expand environment variables from batch files.
11. Most MSDOG commands refuse to understand "-s" as an option specifier
while others like "move" always accept it -- undocumentedly, of course.
12. You can corrupt the file system with system calls with perfectly
valid (and reasonable) arguments.
13. Almost every version of MSDOG has its own little perculiarities with
parsing of commands. When, e.g., was the @-prefix convention intro-
duced? Which versions allow you to echo a greater-than-sign?
14. You cannot escape the special characters of the shell. In newer versions
you can put them inside double quotes, but -- guess what -- the quotes
are passed as part of the argument.
15. The read-only bits for directories are never used.
16. You can rename files but not directories.
17. Silly limits are all over the place: "sort" refuses to sort more than
64K; if "fc" doesn't find differences early enough then it invents some;
the shell can only set PATH to strings less than 128 characters; file
commands like "del" can work only work on one file specification.
18. You cannot redirect stderr with the default shell.
19. At least five different programs for packing executables have been used
for the lastest version of MSDOG. The packers make it a little bit
more difficult to patch binaries. Just a little.
20. Batch programs can take more than nine parameters, but you cannot refer
to the tenth before you give up access to the first (et cetera).
21. The "debug" program has not been updated to understand the instructions
of the 186, 286, 386, 486, Pentium, 8087, 287, and 187/387 processors.
22. You cannot pass certain characters (like "=") as part of the command
line to batch programs.
23. MSDOG is not reentrant, nor is it protected against attempts of
reentrance.
24. You can open a file like "c:\foo\..\config.sys" even if you don't have
a "foo" directory.
25. Not all versions of MSDOG can echo an empty line with the built-in
"echo" command.
26. Running a batch file from a batch file means exec-ing it by default,
so the rest of the first batch file is never seen. This actually means
that you cannot use batch files as wrappers if you want to fix some
behaviour.
27. The default shell doesn't even think of exiting when end-of-file is
encountered on standard input. That this hangs the system doesn't
seem to bother anyone.
28. Utilities like "sed" are not provided with MSDOG so you cannot rely on
users having them. You cannot rely on, say, "edlin" either because not
all MSDOG versions have that either.
29. Many utilites from MSDOG check that they run under the version of MSDOG
that they were compiled for, even if they use only documented features
and would work perfectly well with any version of MSDOG since 2.0.
30. The file system is limited to approximately 2^16 allocation units. This
means that as disks become larger, so do the allocation units and the
amount of disk space that cannot be used.
Bonus reason regarding PCDOG, IBM's version of MSDOG:
1. Some versions of PCDOG have been known to explicitly check that the
harddisks in the system are prepared with PCDOG and not MSDOG. If
not, then the harddisks are simply ignored.
This list is copyright 1994 by Morten Welinder (terra@diku.dk). It may be
distributed under the terms of Gnu General Public License version 2.
==============================================================================